/*
 * Copyright (c) 2008, Xiong Yingfei, the University of Tokyo
 * All rights reserved.
 */
package ac.jp.u_tokyo.SyncLib.language.factories;

import ac.jp.u_tokyo.SyncLib.SetMembers;
import ac.jp.u_tokyo.SyncLib.Sync;
import ac.jp.u_tokyo.SyncLib.SyncFactory;
import ac.jp.u_tokyo.SyncLib.SetMembers.MembersTester;
import ac.jp.u_tokyo.SyncLib.SetMembers.NoDefaultValue;
import ac.jp.u_tokyo.SyncLib.util.Helper;

public class TestEqualFactory implements SyncFactory
{
	Object _value;
	
	private class EqualTester implements MembersTester{

		public int getCount()
		{
			return 1;
		}

		public boolean isMembers(Object[] v)
		{
			return Helper.areEqual(v[0], _value);
		}
		
	}

	public void setValue(Object value)
	{
		_value = value;
	}


	public Sync create()
	{
		return new SetMembers(new EqualTester(), new NoDefaultValue());
	}
	
}
